<template>
	<view>
		<view class="item" v-for="(item,index) in seniclist" @tap="toDetails(item.objectId)">
			<view class="pic">
				<image :src="item.img" mode=""></image>
			</view>
			<view class="msg">
				<view class="name">{{item.name}}</view>
				<view class="intro">{{item.intro}}</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import {
		onLoad
	} from "@dcloudio/uni-app"
	import {
		ref
	} from 'vue'
	import {
		CONFIG
	} from "../../utils/config"
	
	const type=ref(1)
	onLoad(()=>{
		getSenic()
	})
	
	const seniclist = ref([])
	async function getSenic(){
		let query = {
			"type":1
		}
		let queryStr = JSON.stringify(query)
		console.log(query)
		console.log(queryStr)
		let res = await uni.$get(CONFIG.leanCloud_url+"/1.1/classes/SecicItem",{
			where:queryStr
		})
		console.log(res)
		if(res.statusCode==200){
			seniclist.value=res.data.results
		}
		console.log(seniclist.value)
	}
	
	function toDetails(id){
		uni.navigateTo({
			url:"/pages/playDetails/playDetails?id="+id
		})
	}
</script>

<style>

</style>
